import 'package:flutter/material.dart';
import './Radio.dart';

class RadioGroup extends Row{

  late double containerWidth;

  RadioGroup({
    super.key,
    required List<RadioItem> list,
    double? labelWidth,
    AlignmentGeometry? labelAlignment,
    String? label,
    double? fontSize,
    FontWeight? fontWeight,
    BuildContext? context
  }) : super(
    children: [
        Container(
          height: 48,
          width: labelWidth,
          alignment: labelAlignment,
          decoration: const BoxDecoration(
            border: Border(
              bottom: BorderSide(color: Color.fromARGB(255, 243, 243, 243), width: 1.0), // 设置下边框样式
            ),
          ),
          child: Padding(
              padding:const EdgeInsets.only(left: 10, right: 10, top: 13),
              child: Text(
                  label??'',
                  style: TextStyle(
                    fontSize: fontSize??16,
                    fontWeight: fontWeight??FontWeight.w600,
                    color: const Color.fromARGB(255, 128, 128, 128),
                  )
              )
          ),
      ),
      Container(
        width: MediaQuery.of(context!).size.width - labelWidth!,
        height: 48,
        decoration: const BoxDecoration(
          border: Border(
            bottom: BorderSide(color: Color.fromARGB(255, 243, 243, 243), width: 1.0), // 设置下边框样式
          ),
        ),
        child: Row(
          children: list,
        ),
      )
    ]
  );
}